<template>
	<view style="padding-bottom: 160upx;">
		<view class="zcModel-title zcJustifyC_between">车辆和车主信息</view>
		<block v-for="(item,idx) in orderLists" :key="idx">
			<zc-card :zcIndex="idx" :cardItem="item"></zc-card>
		</block>
		<view class="zcPicker-model uni-flex zcAlignI_center zcJustifyC_between">
			<view class="zcPicker-titel">使用性质：</view>
			<view class="zcPicker-model-item iconfont icon-sanjiaojiantoutriangular-copy-after">
				<picker mode="selector" :disabled="true">
					<view class="uni-input">{{VehicleBizType}}</view>
				</picker>
			</view>
			
		</view>
		<block v-for="(item1,idx1) in orderLists1" :key="idx1">
			<zc-card :zcIndex="idx1" :cardItem="item1"></zc-card>
		</block>
		<view class="zcPicker-model">
			<view class="uni-flex zcAlignI_center zcJustifyC_between">
				<view class="zcPicker-titel">被保人信息：</view>
				<view class="zcPicker-model-item">
					<checkbox-group @change="checkboxChange">
						<label class="checkbox">
							<checkbox value="同车主" :disabled="true" :checked="InsureManIsOwner" color="#FFFFFF" style="transform: scale(0.5);" />同车主
						</label>
					</checkbox-group>
				</view>
			</view>
			<view class="zcModel-card" v-show="!InsureManIsOwner">
				<view class="zcModel-card-item uni-flex zcAlignI_center">
					<view>姓名：</view>
					<view>{{InsureManName}}</view>
				</view>
				<view class="zcModel-card-item uni-flex zcAlignI_center">
					<view>证件类型：</view>
					<view>{{InsureManCardType}}</view>
				</view>
				<view class="zcModel-card-item uni-flex zcAlignI_center">
					<view>证件号：</view>
					<view>{{InsureManCardNo}}</view>
				</view>
			</view>
		</view>
		<view class="zcPicker-model">
			<view class="uni-flex zcAlignI_center zcJustifyC_between">
				<view class="zcPicker-titel">投保人信息：</view>
				<view class="zcPicker-model-item">
					<checkbox-group @change="checkboxChange">
						<label class="checkbox">
							<checkbox value="同车主" :disabled="true" :checked="InsureHolderIsOwner" color="#FFFFFF" style="transform: scale(0.5);" />同车主
						</label>
					</checkbox-group>
				</view>
			</view>
			<view class="zcModel-card" v-show="!InsureHolderIsOwner">
				<view class="zcModel-card-item uni-flex zcAlignI_center">
					<view>姓名：</view>
					<view>{{InsureHolderName}}</view>
				</view>
				<view class="zcModel-card-item uni-flex zcAlignI_center">
					<view>证件类型：</view>
					<view>{{InsureHolderCardType}}</view>
				</view>
				<view class="zcModel-card-item uni-flex zcAlignI_center">
					<view>证件号：</view>
					<view>{{InsureHolderCardNo}}</view>
				</view>
			</view>
		</view>
		
		<view v-if="OrderLabel.length>0" class="zcModel-title zcJustifyC_between">订单标签</view>
		<block v-for="(item,index) in OrderLabel" :key="index">
			<view class="uni-flex zcFlex_column" style="background-color: #FFFFFF;border-bottom: 3px solid #f8f8f8;">
				<view class="uni-flex zcJustifyC_between zcAlignI_center" style="padding: 20upx;">
					{{item.title}}：
					<input class="uni-flex-item" disabled="true" style="margin: 0 30upx;" type="text" :value="item.aValue" />
					<view @tap="zcPopupShow(index,item.isShow)" class="iconfont icon-sanjiaojiantoutriangular-copy"></view>
				</view>
				<view v-show="item.isShow" class="popup_content">
					<block v-for="(item1,idx) in item.list" :key="idx">
						<view :data-popupId="index" class="popup_item" :class="{active:item.actives.indexOf(idx) !== (-1)}" :id="idx" :style="{'flex': '0 0 '+item.row+'%'}" @tap="doChenkItem">{{item1.Name}}</view>
					</block>
				</view>
			</view>
		</block>
		
		<view class="zcModel-title zcJustifyC_between" style="padding-bottom: 0;">险种信息</view>
		<view class="zc-tab-bar" >
			<view v-show="InsureTrafficIsShow" class="zcJustifyC_between zcAlignI_center zcBizStyle">
				<checkbox-group>
					<label class="checkbox">
						<checkbox :checked="true" :disabled="true" style="transform: scale(0.5);"/>
					</label>
				</checkbox-group>
				<view style="flex-shrink: 0;flex: 1;">交强险</view>
				<view class="zcJustifyC_between zcAlignI_center" style="display: flex;flex: 1;position: relative;">
					<input type="text" placeholder-style="text-align: center;" disabled="true" :placeholder="InsureTrafficDate" />
				</view>
			</view>
			
			<view v-show="InsureTrafficIsShow" >
				<block v-for="(item,index) in InsureTrafficItems" :key="index">
					<view class="zcJustifyC_between zcAlignI_center" style="display: flex;padding: 20upx 0;margin: 0 20upx;border-top: 1px solid #F5F5F5;">
						<checkbox-group >
							<label class="checkbox">
								<checkbox :checked="true" :disabled="true" style="transform: scale(0.5);" />
							</label>
						</checkbox-group>
						<view style="flex-shrink: 0;flex: 1;" >{{item.InsureTypeName}}</view>
						<view class="zcLabel" v-show="item.InsureTypeFreePayCode?true:false" :class="item.InsureTypeIsFreePay?'zcLabelActive':''" >不计免赔</view>
						
						<view style="width: 172upx;flex: 0 1 auto;" class="zcPicker-model-item" >
							<input style="padding: 0 20upx;text-align: right;padding-right: 40upx;" disabled="true" type="text" :value="item.InsureAmountText" />
							
						</view>
					</view>
				</block>
			</view>
			
			<view v-show="InsureBizIsShow" class="zcJustifyC_between zcAlignI_center zcBizStyle" >
				<checkbox-group :id='2' @change="zcTBcheckBox3">
					<label class="checkbox">
						<checkbox :checked="true" :disabled="true" style="transform: scale(0.5);" />
					</label>
				</checkbox-group>
				<view style="flex-shrink: 0;flex: 1;" >商业险</view>
				<view class="zcJustifyC_between zcAlignI_center" style="display: flex;flex: 1;position: relative;">
					<input type="text" placeholder-style="text-align: center;" disabled="true"  :placeholder="InsureBizDate" />
				</view>
			</view>
			
			<view v-show="InsureBizIsShow">
				<block v-for="(item,index) in InsureBizItems" :key="index">
					<view class="zcJustifyC_between zcAlignI_center" style="display: flex;padding: 20upx 0;margin: 0 20upx;border-top: 1px solid #F5F5F5;">
						<checkbox-group >
							<label class="checkbox">
								<checkbox :checked="true" :disabled="true" style="transform: scale(0.5);" />
							</label>
						</checkbox-group>
						<view style="flex-shrink: 0;flex: 1;" >{{item.InsureTypeName}}</view>
						<view class="zcLabel" v-show="item.InsureTypeFreePayCode?true:false" :class="item.InsureTypeIsFreePay?'zcLabelActive':''">不计免赔</view>
						
						<view style="width: 172upx;flex: 0 1 auto;" class="zcPicker-model-item" >
							<input style="padding: 0 20upx;text-align: right;padding-right: 40upx;" disabled="true" type="text" :value="item.InsureAmountText" />
						</view>
					</view>
				</block>
			</view>
			
		</view>
		
		<view class="zcCard-item uni-flex zcAlignI_center zcJustifyC_between">
			<view>交强险：<view>{{InsureTrafficMoney}}</view></view>
            <view>车船税：<view>{{VehicleTax}}</view></view>
			<view>商业险：<view>{{InsureBizMoney}}</view></view>
		</view>
        <view class="zcCard-item uni-flex zcAlignI_center zcJustifyC_end">
        	<view>总保费：<view>{{InsureMoney}}</view></view>
        </view>
		
		<!-- 附件信息 -->
		<view class="zcModel-title zcJustifyC_between">附件信息</view>
		<view class="uni-flex zcAlignI_center zcJustifyC_between zcCustomPhoto" style="width: 100%;padding: 0 10upx;box-sizing: border-box;">
			<block v-for="(img,index) in Files" :key="index">
				<zc-up-photo :isOne="true" :maxlength="1" :initBgImg="img.bgImag" :image="img" :zcId="img.id" @upImage="upImage" @rmImage="rmImage" ></zc-up-photo>
			</block>
		</view>
		
		<view class="zcModel-title zcJustifyC_between">其他附件信息</view>
		<zc-up-photo :image="img8" :maxlength="5" :initBgImg="img8.bgImag" :zcId="img8.id" @upImage="upImage" @rmImage="rmImage" ></zc-up-photo>
		
		<view class="zcFooter-but uni-flex">
            <button @tap="zcOrderModify">修改</button>
			<button @tap="zcSubmit">提交核保</button>
		</view>
		
		
	</view>
</template>

<script>
	import zcCard from "../../components/zc-card/zc-card.vue"
	import zcUpPhoto from "../../components/zc-upPhoto/zc-upPhoto.vue"
	
	let _this;
	export default {
		components:{
			zcCard,
			zcUpPhoto
		},
		data() {
			return {
				InsureOrderSN:'',
				VehicleBizType:'',	// 使用性质
				InsureBizDate:'',	// 商业险起期
				InsureBizIsShow:false,
				InsureBizItems:[],	// 商业险险种
				InsureTrafficDate:'',	//交强险 起期
				InsureTrafficIsShow:false,
				InsureTrafficItems:[],	//交强险 险种
				InsureManIsOwner:'',	// 被保人 是否为车主
				InsureManName:'',	// 被保人姓名
				InsureManCardType:'',	// 被保人证件类型
				InsureManCardNo:'',	// 被保人证件号
				InsureHolderIsOwner:'',	// 投保人 是否为车主
				InsureHolderName:'',	// 投保人姓名
				InsureHolderCardType:'',	//投保人证件类型
				InsureHolderCardNo:'',	// 投保人证件号
				OrderLabel:[],	//	订单标签
				OrderLabelInfo:[],	//	订单标签（未处理数据）
				orderLists:[
					{
						title:'车牌号：',
						value:'',
						type:"input",
						isDisabled:true,
						width:30,
						inputStyle:{	//input输入框样式
							placeholderText:"",		//默认显示内容
							type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
						},
						rStyle:{type:""}
					},
					{
						title:'车架号：',
						value:'',
						type:"input",
						isDisabled:true,
						width:30,
						inputStyle:{	//input输入框样式
							placeholderText:"",		//默认显示内容
							type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
						},
						rStyle:{type:""}
					},
					{
						title:'发动机号：',
						value:'',
						type:"input",
						isDisabled:true,
						width:30,
						inputStyle:{	//input输入框样式
							placeholderText:"",		//默认显示内容
							type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
						},
						rStyle:{type:""}
					},
					{
						title:'初登日期：',
						value:'',
						type:"input",
						isDisabled:true,
						width:30,
						inputStyle:{	//input输入框样式
							placeholderText:"",		//默认显示内容
							type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
						},
						rStyle:{type:""}
					}
				],
				orderLists1:[
					{
						title:'新/旧/过户车：',
						value:'',
						type:"radio",
						isDisabled:true,
						width:30,
						optionBoxs:[	//选项框 样式
							{
								text:"新车",	//显示值
								value:"新车",	//隐藏值
								boxSize:0.5,	// 范围：0.5~1
								isBoxCheck:false,	//是否选中
								isBoxDisabled:true,		//是否禁止
								boxColor:"#3CA4FA"	//选中后样式颜色
							},
							{
								text:"旧车",	//显示值
								value:"旧车",	//隐藏值
								boxSize:0.5,	// 范围：0.5~1
								isBoxCheck:true,	//是否选中
								isBoxDisabled:true,		//是否禁止
								boxColor:"#3CA4FA"	//选中后样式颜色
							},
							{
								text:"过户车",	//显示值
								value:"过户车",	//隐藏值
								boxSize:0.5,	// 范围：0.5~1
								isBoxCheck:false,	//是否选中
								isBoxDisabled:true,		//是否禁止
								boxColor:"#3CA4FA"	//选中后样式颜色
							}
						],
						rStyle:{type:""}
					},
					{
						title:'过户日期：',
						value:'',
						type:"input",
						isShow:false,
						isDisabled:true,
						width:30,
						inputStyle:{	//input输入框样式
							placeholderText:"",		//默认显示内容
							type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
						},
						rStyle:{type:""}
					},
					{
						title:'车主类别：',
						value:'',
						type:"radio",
						isDisabled:true,
						width:30,
						optionBoxs:[	//选项框 样式
							{
								text:"个人",	//显示值
								value:"个人",	//隐藏值
								boxSize:0.5,	// 范围：0.5~1
								isBoxCheck:false,	//是否选中
								isBoxDisabled:true,		//是否禁止
								boxColor:"#3CA4FA"	//选中后样式颜色
							},
							{
								text:"企业",	//显示值
								value:"企业",	//隐藏值
								boxSize:0.5,	// 范围：0.5~1
								isBoxCheck:true,	//是否选中
								isBoxDisabled:true,		//是否禁止
								boxColor:"#3CA4FA"	//选中后样式颜色
							},
							{
								text:"机关团体",	//显示值
								value:"机关团体",	//隐藏值
								boxSize:0.5,	// 范围：0.5~1
								isBoxCheck:false,	//是否选中
								isBoxDisabled:true,		//是否禁止
								boxColor:"#3CA4FA"	//选中后样式颜色
							}
						],
						rStyle:{type:""}
					},
					{
						title:'车主姓名：',
						value:'',
						type:"input",
						isDisabled:true,
						width:30,
						inputStyle:{	//input输入框样式
							placeholderText:"",		//默认显示内容
							type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
						},
						rStyle:{type:""}
					},
					{
						title:'证件类型：',
						value:'0',
						type:"picker",
						isDisabled:true,
						mode:'selector',
						width:30,
						picker:this.$ZcPublic.Constant.CAR_TYPE,
						rStyle:{type:""}
					},
					{
						title:'证件号：',
						value:'',
						type:"input",
						isDisabled:true,
						width:30,
						inputStyle:{	//input输入框样式
							placeholderText:"",		//默认显示内容
							type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
						},
						rStyle:{type:""}
					},
					{
						title:'联系电话：',
						value:'',
						type:"input",
						isDisabled:true,
						width:30,
						inputStyle:{	//input输入框样式
							placeholderText:"",		//默认显示内容
							type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
						},
						rStyle:{type:""}
					},
					{
						title:'其他联系方式：',
						value:'',
						type:"input",
						isDisabled:true,
						width:30,
						inputStyle:{	//input输入框样式
							placeholderText:"",		//默认显示内容
							type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
						},
						rStyle:{type:""}
					}
				],
				InsureTrafficMoney:0,	//交强险 保费合计
				InsureBizMoney:0,	//交强险 保费合计
                VehicleTax:0,  // 车船税 保费合计
				InsureMoney:0,	//交强险 保费合计
				Files:[
					{
						id:1,
						bgImag: this.$ZcPublic.Domain+'UniImages/car2.png',
						images:[],
						imgInfos:[]
					},
					{
						id:2,
						bgImag: this.$ZcPublic.Domain+'UniImages/car1.png',
						images:[],
						imgInfos:[]
					},
					{
						id:3,
						bgImag: this.$ZcPublic.Domain+'UniImages/car4.png',
						images:[],
						imgInfos:[]
					},
					{
						id:4,
						bgImag: this.$ZcPublic.Domain+'UniImages/car3.png',
						images:[],
						imgInfos:[]
					},
					{
						id:5,
						bgImag: this.$ZcPublic.Domain+'UniImages/car6.png',
						images:[],
						imgInfos:[]
					},
					{
						id:6,
						bgImag: this.$ZcPublic.Domain+'UniImages/car5.png',
						images:[],
						imgInfos:[]
					},
					{
						id:7,
						bgImag: this.$ZcPublic.Domain+'UniImages/car7.png',
						images:[],
						imgInfos:[]
					}
				],
				img8:{
					id:8,
					bgImag: this.$ZcPublic.Domain+'UniImages/car8.png',
					images:[],
					imgInfos:[]
				},
			}
		},
		onLoad(e) {
			_this = this;
			if (e.InsureOrderSN) {
				_this.InsureOrderSN = e.InsureOrderSN;
				//  获取 算价订单详情
				_this.zcGetInsureOrder(_this.InsureOrderSN);
			}
		},
		onUnload() {
			console.log('返回');
			uni.switchTab({
				url:'../order/order'
			})
		},
		methods: {
			//标签 选中 操作
			doChenkItem(e) {	
				// console.log('当前选择：',_this.items3Infos[0]);
				let id  = parseInt(e.target.id);
				let popupId = parseInt(e.target.dataset.popupid);
				
				if (_this.OrderLabel[popupId].isDisabled) {
					return;
				}
			},
			//标签 操作
			zcPopupShow(index,bl) {		// 显示隐藏 标签选项
				_this.OrderLabel[index].isShow = !bl;
			},
			
			upImage(res) {
				console.log('upImage8 = ',res);
				
				switch (res.id){
					case 1:
						_this.Files[0].images = res.images;
						_this.Files[0].imgInfos = res.imgInfos;
						break;
					case 2:
						_this.Files[1].images = res.images;
						_this.Files[1].imgInfos = res.imgInfos;
						break;
					case 3:
						_this.Files[2].images = res.images;
						_this.Files[2].imgInfos = res.imgInfos;
						break;
					case 4:
						_this.Files[3].images = res.images;	
						_this.Files[3].imgInfos = res.imgInfos;
						break;
					case 5:
						_this.Files[4].images = res.images;
						_this.Files[4].imgInfos = res.imgInfos;
						break;
					case 6:
						_this.Files[5].images = res.images;
						_this.Files[5].imgInfos = res.imgInfos;
						break;
					case 7:
						_this.Files[6].images = res.images;
						_this.Files[6].imgInfos = res.imgInfos;
						break;
					case 8:
						_this.img8.images = res.images;
						_this.img8.imgInfos = res.imgInfos;
						break;
					default:
						break;
				}
			},
			rmImage(res) {
				console.log('sc = ',res);
				
				switch (res.id){
					case 1:
						_this.Files[0].images.splice(res.index,1);
						break;
					case 2:
						_this.Files[1].images.splice(res.index,1);
						break;
					case 3:
						_this.Files[2].images.splice(res.index,1);
						break;
					case 4:
						_this.Files[3].images.splice(res.index,1);
						break;
					case 5:
						_this.Files[4].images.splice(res.index,1);
						break;
					case 6:
						_this.Files[5].images.splice(res.index,1);
						break;
					case 7:
						_this.Files[6].images.splice(res.index,1);
						break;
					case 8:
						_this.img8.images.splice(res.index,1);
						break;
					default:
						break;
				}
			},
			
			zcGetInsureOrder(IOSN) {
				_this.$ZcPublic.Server.Post({
					IsNeedLogin: true,
					Paras: {
						Name: 'uni_Insure_Detail',
						Action: 'Ext_GetInsureOrder',
						Data: {
							SN:IOSN
						}
					},
					Callback:function(resjson,scope) {
						if (resjson.state === 'back') {
							console.log('算价订单 详情 = ',resjson.data);
							if (!resjson.success) {
								uni.showModal({
									title:'温馨提示',
									showCancel:false,
									content:''+resjson.msg
								})
								return;
							}
							
							let insureOrder = resjson.data;
							
							if (insureOrder) {
								_this.orderLists[0].value = insureOrder.VehiclePlateNo;	// 车牌号
								_this.orderLists[1].value = insureOrder.VehicleVIN;	// 车架号
								_this.orderLists[2].value = insureOrder.VehicleEngineNo;	// 发动机号
								_this.orderLists[3].value = insureOrder.VehicleRegistryDate;	// 初登日期
								
								_this.orderLists1[1].isShow = false;
								if (insureOrder.VehicleRegType == '过户车') {
									_this.orderLists1[1].isShow = true;
								}
								_this.orderLists1[0].value = insureOrder.VehicleRegType;	// 新/旧/过户车 / 车辆注册类别
								_this.orderLists1[1].value = insureOrder.VehicleRegTransferDate;	// 过户日期
								_this.orderLists1[2].value = insureOrder.VehicleOwnerType;	// 车主类别
								_this.orderLists1[3].value = insureOrder.VehicleOwnerName;	// 车主姓名
								// _this.orderLists1[4].value = insureOrder.VehicleOwnerCardType;	// 证件类型
								_this.orderLists1[5].value = insureOrder.VehicleOwnerCardNo;	// 证件号
								_this.orderLists1[6].value = insureOrder.VehicleOwnerTelephone;	// 联系电话
								_this.orderLists1[7].value = insureOrder.CustomerOtherContacts;	// 联系电话
								
								_this.VehicleBizType = insureOrder.VehicleBizType;	// 使用性质
								_this.InsureBizDate = insureOrder.InsureBizStartDate;	// 商业险起期
								
								if (insureOrder.InsureBizItems.length > 0) {		// 商业险险种
									_this.InsureBizIsShow = true;
									_this.InsureBizItems = insureOrder.InsureBizItems;
								}
								
								_this.InsureTrafficDate = insureOrder.InsureTrafficStartDate;	//交强险 起期
								
								if (insureOrder.InsureTrafficItems.length > 0) {		// 商业险险种
									_this.InsureTrafficIsShow = true;
									_this.InsureTrafficItems = insureOrder.InsureTrafficItems;	//交强险 险种
								}
								
								_this.InsureManIsOwner = insureOrder.InsureManIsOwner;	// 被保人 是否为车主
								
								if (!insureOrder.InsureManIsOwner) {
									_this.InsureManName = insureOrder.InsureManName;	// 被保人姓名
									_this.InsureManCardType = insureOrder.InsureManCardType;	// 被保人证件类型
									_this.InsureManCardNo = insureOrder.InsureManCardNo;	// 被保人证件号
									
								}
								_this.InsureHolderIsOwner = insureOrder.InsureHolderIsOwner;	// 投保人 是否为车主
								if (!insureOrder.InsureHolderIsOwner) {
									_this.InsureHolderName = insureOrder.InsureHolderName;	// 投保人姓名
									_this.InsureHolderCardType = insureOrder.InsureHolderCardType;	//投保人证件类型
									_this.InsureHolderCardNo = insureOrder.InsureHolderCardNo;	// 投保人证件号
								}
								
								_this.InsureTrafficMoney = insureOrder.InsureTrafficMoney;	// 交强险 保费合计
								_this.InsureBizMoney = insureOrder.InsureBizMoney;	// 商业险 保费合计
                                _this.VehicleTax = insureOrder.VehicleTax;	// 车船税 保费合计
								_this.InsureMoney = insureOrder.InsureMoney;	// 总保费合计
								
								
								// 初始化 标签
								_this.OrderLabel = [];
								if (resjson.data.Labels !== null && resjson.data.Labels.length > 0) {
									_this.OrderLabelInfo = resjson.data.Labels;
									
									for (let i = 0; i < resjson.data.Labels.length; i++) {
										if (resjson.data.Labels[i].childs !== null && resjson.data.Labels[i].childs.length > 0) {
											for (let j = 0; j < resjson.data.Labels[i].childs.length; j++) {
												let item = {
													title:resjson.data.Labels[i].childs[j].Name,
													Code:resjson.data.Labels[i].childs[j].Code,
													isShow:false,
													value:'',
													isDisabled:true,
													row:48,
													type:'audio',
													info:resjson.data.Labels[i].childs[j],
													actives:[],
													aValue:'',
													list:resjson.data.Labels[i].childs[j].childs
												}
												if (resjson.data.Labels[i].childs[j].sModel === '单选') {
													item.type = 'audio';
												}else if (resjson.data.Labels[i].childs[j].sModel === '多选') {
													item.type = 'checkbox';
												}
												if (resjson.data.Labels[i].childs[j].OnlyWrite) {
													item.isDisabled = true;
												}
												for (let s = 0; s < resjson.data.Labels[i].childs[j].childs.length; s++) {
													if (resjson.data.Labels[i].childs[j].childs[s].isS) {
														item.actives.push(s);
													}
												}
												for (let a = 0; a < item.actives.length; a++) {
													if (a === 0) {
														item.aValue = item.list[item.actives[a]].Name;
													}else {
														item.aValue = item.aValue +' , '+ item.list[item.actives[a]].Name;
													}
												}
												
												_this.OrderLabel.push(item);
												
												//  判断是否存在 二级标签
												for (var k = 0; k < resjson.data.Labels[i].childs[j].childs.length; k++) {
													
													if (resjson.data.Labels[i].childs[j].childs[k].oS !== null && resjson.data.Labels[i].childs[j].childs[k].isS && resjson.data.Labels[i].childs[j].childs[k].oS.length > 0) {
														
														for (var m = 0; m < resjson.data.Labels[i].childs[j].childs[k].oS.length; m++) {
															let item1 = {
																title:resjson.data.Labels[i].childs[j].childs[k].oS[m].Name,
																Code:resjson.data.Labels[i].childs[j].childs[k].oS[m].Code,
																isShow:false,
																value:resjson.data.Labels[i].childs[j].childs[k].Code,
																isDisabled:true,
																row:48,
																type:'audio',
																info:resjson.data.Labels[i].childs[j].childs[k].oS[m],
																actives:[],
																aValue:'',
																list:resjson.data.Labels[i].childs[j].childs[k].oS[m].childs
															}
															if (resjson.data.Labels[i].childs[j].childs[k].oS[m].sModel === '单选') {
																item1.type = 'audio';
															}else if (resjson.data.Labels[i].childs[j].childs[k].oS[m].sModel === '多选') {
																item1.type = 'checkbox';
															}
															if (resjson.data.Labels[i].childs[j].childs[k].oS[m].OnlyWrite) {
																item1.isDisabled = true;
															}
															for (var t = 0; t < resjson.data.Labels[i].childs[j].childs[k].oS[m].childs.length; t++) {
																if (resjson.data.Labels[i].childs[j].childs[k].oS[m].childs[t].isS) {
																	item1.actives.push(t);
																}
															}
															for (let a = 0; a < item1.actives.length; a++) {
																if (a === 0) {
																	item1.aValue = item1.list[item1.actives[a]].Name;
																}else {
																	item1.aValue = item1.aValue +' , '+ item1.list[item1.actives[a]].Name;
																}
															}
															
															_this.OrderLabel.push(item1);
														}
														
													}
													// if (resjson.data.Labels[i].childs[j].childs[k].isS) {
													// 	_this.items3[_this.items3.length-1].actives.push(k)
													// }
												}
												
											}
										}
									}
								}
								
								// 	附件信息初始化
								if (insureOrder.Files !== null && insureOrder.Files.length > 0) {
									for (let i = 0; i < insureOrder.Files.length; i++) {
										if (insureOrder.Files[i].FileType === '行驶证正本') {
											_this.Files[0].images = [];
											_this.Files[0].imgInfos = [];
											_this.Files[0].images.push({url:insureOrder.Files[i].LUrl});
											_this.Files[0].imgInfos.push(insureOrder.Files[i]);
										}else if (insureOrder.Files[i].FileType === '行驶证副本') {
											_this.Files[1].images = [];
											_this.Files[1].imgInfos = [];
											_this.Files[1].images.push({url:insureOrder.Files[i].LUrl});
											_this.Files[1].imgInfos.push(insureOrder.Files[i]);
										}else if (insureOrder.Files[i].FileType === '驾驶证正本') {
											_this.Files[2].images = [];
											_this.Files[2].imgInfos = [];
											_this.Files[2].images.push({url:insureOrder.Files[i].LUrl});
											_this.Files[2].imgInfos.push(insureOrder.Files[i]);
										}else if (insureOrder.Files[i].FileType === '驾驶证副本') {
											_this.Files[3].images = [];
											_this.Files[3].imgInfos = [];
											_this.Files[3].images.push({url:insureOrder.Files[i].LUrl});
											_this.Files[3].imgInfos.push(insureOrder.Files[i]);
										}else if (insureOrder.Files[i].FileType === '身份证正本') {
											_this.Files[4].images = [];
											_this.Files[4].imgInfos = [];
											_this.Files[4].images.push({url:insureOrder.Files[i].LUrl});
											_this.Files[4].imgInfos.push(insureOrder.Files[i]);
										}else if (insureOrder.Files[i].FileType === '身份证副本') {
											_this.Files[5].images = [];
											_this.Files[5].imgInfos = [];
											_this.Files[5].images.push({url:insureOrder.Files[i].LUrl});
											_this.Files[5].imgInfos.push(insureOrder.Files[i]);
										}else if (insureOrder.Files[i].FileType === '车辆') {
											_this.Files[6].images = [];
											_this.Files[6].imgInfos = [];
											_this.Files[6].images.push({url:insureOrder.Files[i].LUrl});
											_this.Files[6].imgInfos.push(insureOrder.Files[i]);
										}else if (insureOrder.Files[i].FileType === '其他') {
											_this.img8.images = [];
											_this.img8.imgInfos = [];
											_this.img8.images.push({url:insureOrder.Files[i].LUrl});
											_this.img8.imgInfos.push(insureOrder.Files[i]);
										}
									}
								}
								
							}
							
						} else{
							
						}
					},
					Scope: this
				})
			},
            //  算价详情页面跳转到订单修改页面
            zcOrderModify() {
                if (_this.InsureOrderSN) {
                	uni.navigateTo({
                		url: '../order_modify/order_modify?index=0&InsureOrderSN='+_this.InsureOrderSN
                	});
                }
            },
			zcSubmit() {
				// 附件信息 保存数据
				let zcFiles = [];
				for (var i = 0; i < _this.Files[0].imgInfos.length; i++) {
					let imgItem1 = {
						VehicleInfoSN:_this.SN,
						PB_ComAttSN:_this.Files[0].imgInfos[i].SN,
						PB_ComAttURL:_this.Files[0].imgInfos[i].LUrl,
						UpLoadFileName:_this.Files[0].imgInfos[i].FileName,
						FileType:'行驶证正本'
					}
					zcFiles.push(imgItem1);
				}
				for (var i = 0; i < _this.Files[1].imgInfos.length; i++) {
					let imgItem1 = {
						VehicleInfoSN:_this.SN,
						PB_ComAttSN:_this.Files[1].imgInfos[i].SN,
						PB_ComAttURL:_this.Files[1].imgInfos[i].LUrl,
						UpLoadFileName:_this.Files[1].imgInfos[i].FileName,
						FileType:'行驶证副本'
					}
					zcFiles.push(imgItem1);
				}
				for (var i = 0; i < _this.Files[2].imgInfos.length; i++) {
					let imgItem1 = {
						VehicleInfoSN:_this.SN,
						PB_ComAttSN:_this.Files[2].imgInfos[i].SN,
						PB_ComAttURL:_this.Files[2].imgInfos[i].LUrl,
						UpLoadFileName:_this.Files[2].imgInfos[i].FileName,
						FileType:'驾驶证正本'
					}
					zcFiles.push(imgItem1);
				}
				for (var i = 0; i < _this.Files[3].imgInfos.length; i++) {
					let imgItem1 = {
						VehicleInfoSN:_this.SN,
						PB_ComAttSN:_this.Files[3].imgInfos[i].SN,
						PB_ComAttURL:_this.Files[3].imgInfos[i].LUrl,
						UpLoadFileName:_this.Files[3].imgInfos[i].FileName,
						FileType:'驾驶证副本'
					}
					zcFiles.push(imgItem1);
				}
				for (var i = 0; i < _this.Files[4].imgInfos.length; i++) {
					let imgItem1 = {
						VehicleInfoSN:_this.SN,
						PB_ComAttSN:_this.Files[4].imgInfos[i].SN,
						PB_ComAttURL:_this.Files[4].imgInfos[i].LUrl,
						UpLoadFileName:_this.Files[4].imgInfos[i].FileName,
						FileType:'身份证正本'
					}
					zcFiles.push(imgItem1);
				}
				for (var i = 0; i < _this.Files[5].imgInfos.length; i++) {
					let imgItem1 = {
						VehicleInfoSN:_this.SN,
						PB_ComAttSN:_this.Files[5].imgInfos[i].SN,
						PB_ComAttURL:_this.Files[5].imgInfos[i].LUrl,
						UpLoadFileName:_this.Files[5].imgInfos[i].FileName,
						FileType:'身份证副本'
					}
					zcFiles.push(imgItem1);
				}
				for (var i = 0; i < _this.Files[6].imgInfos.length; i++) {
					let imgItem1 = {
						VehicleInfoSN:_this.SN,
						PB_ComAttSN:_this.Files[6].imgInfos[i].SN,
						PB_ComAttURL:_this.Files[6].imgInfos[i].LUrl,
						UpLoadFileName:_this.Files[6].imgInfos[i].FileName,
						FileType:'车辆'
					}
					zcFiles.push(imgItem1);
				}
				if (_this.img8.imgInfos.length>0) {
					for (var i = 0; i < _this.img8.imgInfos.length; i++) {
						let imgItem1 = {
							VehicleInfoSN:_this.SN,
							PB_ComAttSN:_this.img8.imgInfos[i].SN,
							PB_ComAttURL:_this.img8.imgInfos[i].LUrl,
							UpLoadFileName:_this.img8.imgInfos[i].FileName,
							FileType:'其他'
						}
						zcFiles.push(imgItem1);
					}
				}
				
				
				
				_this.$ZcPublic.Server.Post({
					IsNeedLogin: true,
					Paras: {
						Name: 'uni_Insure_Detail',
						Action: 'Ext_SubmitInsureOrder4Verify',
						Data: {
							SN:_this.InsureOrderSN,
							Files:zcFiles
						}
					},
					Callback:function(resjson,scope) {
						if (resjson.state === 'back') {
							console.log('提交 核保 = ',resjson.data);
							if (!resjson.success) {
								uni.showModal({
									title:'温馨提示',
									showCancel:false,
									content:''+resjson.msg
								})
								return;
							}
							
							uni.showToast({
								title:'提交成功！',
								success() {
									uni.reLaunch({
										url:'../order/order'
									})
								}
							})
						} else{
							
						}
					},
					Scope: this
				})
			}
		}
	}
</script>

<style>
	.zcModel-title{padding: 20upx;font-weight: bold;display: flex;color: #999999;}
	
	.card_item{padding: 20upx!important;}
	.card_item input{color: #999999!important;}
	.zcPicker-model{background-color: #FFFFFF;padding: 20upx;border-bottom: 3px solid #F8F8F8;}
	.zcPicker-titel{display: flex;flex-shrink: 0;width: 30%;font-size: 28upx;}
	.zcPicker-model-item{display: flex;flex: 1;height: 100%;align-items: center;}
	.zcPicker-model-item picker{width: 100%;height: 100%;color: #999999!important;flex: 0 0 200upx!important;}
	.zcPicker-model-item .uni-input{padding: 0!important;text-align: left!important;}
	.card_item .card_item_text{position: relative;flex-shrink: 0!important;}
	/* .card_item picker{flex: 0 0 200upx!important;} */
	.card_item .card_item_text>picker{width: 200upx!important;flex: none!important;}
	.card_item .card_item_text>picker .uni-input{position: relative;z-index: 6;}
	.card_item .card_item_text>picker:after{
		font-family: "iconfont" !important;
		font-size: 28upx;
		font-style: normal;
		font-weight: bold;
		position: absolute;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
		content: '\e600';
		top: 0upx;
		right: 276upx;
		/* margin-top: 10upx; */
	}
	.card_item .uni-input{padding: 0!important;text-align: left!important;}
	.uni-input{padding: 0 25upx;text-align: center;font-size: 28upx;color: #999999!important;}
	.card_item radio-group label,checkbox-group label{display: flex;align-items: center;padding-right: 30upx;}
	
	.zcPicker-model-item checkbox-group label{display: flex;align-items: center;padding-right: 50upx;}
	.card_item radio-group label radio
	,.card_item checkbox-group label checkbox
	,.zcPicker-model-item checkbox-group label checkbox{margin-right: 50upx;}
	
	.card_item radio-group label radio .wx-radio-input
	,.card_item checkbox-group label checkbox .wx-checkbox-input
	,.zcPicker-model-item checkbox-group label checkbox .wx-checkbox-input{position: absolute;left: 0;}
	
	radio .wx-radio-input{border-radius: 20%;}
	
	.icon-sanjiaojiantoutriangular-copy-after:after{content: "\e600";font-weight: bold;}
	
	.zcModel-card{margin-bottom: 30upx;}
	.zcModel-card-item{background-color: #FFFFFF;padding: 10upx 0upx;font-size: 28upx;box-sizing: border-box;background-color: #F5F5F5;}
	.zcModel-card-item view{box-sizing: border-box;font-size: 28upx;color: #999999;}
	.zcModel-card-item view:first-child{width: 30%;color: #333333;}
	.zcModel-card-item-text{white-space: normal;display: block;}
	
	
	
	.zc-tab-bar{
		overflow: hidden;
		display: block;
		will-change:transform;
		transition: all 0.4S ease-in;
		width: 100%;
		/* height: 100%; */
		/* position: absolute; */
		background-color: #FFFFFF;
		margin-bottom: 50upx;
	}
	.zc-tab-bar>view{padding: 20upx;}
	.zc-tab-bar>view>view{font-size: 28upx;}
	radio .wx-radio-input{border-radius: 20%;}
	.zc-tab-bar checkbox .wx-checkbox-input{border-radius: 100%;}
	/* checkbox .wx-checkbox-input.wx-checkbox-input-checked{background-color: #3CA4FA!important;} */
	.zc-tab-bar checkbox-group{justify-content: flex-end;width: inherit;}
	.zc-tab-bar checkbox .wx-checkbox-input.wx-checkbox-input-checked::before{color: #FFFFFF!important;}
	.zc-tab-bar .card_item{border: none!important;padding: 0!important;}
	.zc-tab-bar zc-card{flex: 1;}
	.zc-tab-bar .checkbox{padding: 0!important;}.zc-tab-bar .checkbox checkbox{margin: 0!important;}
	.zcLabel{padding: 0 10upx;border-radius: 16upx;border: 2upx solid #C5C5C5;color: #C5C5C5;}
	.zcLabelActive{border-color:#3CA4FA;color: #3CA4FA;}
	.zc-tab-bar .uni-input{text-align: right;background-color: rgba(255,255,255,0.1);padding-right: 40upx;}
	/* 险种样式 */
	.zcBizStyle{display: flex;border-top: 30upx solid #F5F5F5;} 
	.zcBizStyle input{display: flex;flex: 1;position: absolute;right: 0;margin-left: 35upx;margin-right: 50upx;border-bottom: 1px solid #999999;}
	.zcBizStyle .uni-input{text-align: center;}
	
	
	.zcCard-item{background-color: #FFFFFF;padding: 20upx;}
	.zcCard-item view{display: flex;align-items: center;flex-shrink: 0;}
	.zcCard-item view view{font-weight: bold;}
	
	/* 标签 */
	.popup_content{
		display: flex;
		flex-wrap: wrap;
		padding: 10upx 20upx;
		flex-direction: row;
		background-color: #FFFFFF;
	}
	.popup_item{
		display: flex;
		float: left;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		flex-shrink: 0;
		border: 1px solid #999999;
		color: #999999;
		margin: 10upx 1%;
		height: 52upx;
		border-radius: 52upx;
		box-sizing: border-box;
	}
	.active{border-color: #26a6ff;color: #26a6ff;}
	/* ----END----- */
	/* 附件样式 */
	zc-up-photo,.zcUpPhoto_name{flex: 0 0 48%;}
	.zcCustomPhoto{flex-wrap: wrap;}
	.zcCustomPhoto .zc_addImg{margin-left: -84upx;margin-top: -84upx;}
	
	.zcFooter-but{position: fixed;bottom: 0;left: 0;width: 100%;z-index: 10;background-color: #F4F5F6;}
	.zcFooter-but button:first-child{flex: 1;border: 2upx solid #3CA4FA;color: #3CA4FA;border-radius: 0;font-size: 32upx;}
	.zcFooter-but button:last-child{flex: 1;background-color: rgba(60, 164, 250, 1);color: #FFFFFF;border-radius: 0;font-size: 32upx;}
	
	.button-hover {opacity: 0.6;}
	
</style>
